<template>
  <div class="login">
    <div class="loginbox">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <span>登录</span>
        </div>
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="账号">
            <el-input v-model="form.name"></el-input>
          </el-form-item>
          <el-form-item label="密码">
            <el-input
              type="password"
              show-password
              v-model="form.password"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">立即登录</el-button>
          </el-form-item>
        </el-form>
      </el-card>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        name: "admin",
        password: "666666",
      },
    };
  },

  methods: {
    onSubmit() {
      console.log("submit!", this.form);

      sessionStorage.setItem("name", this.form.name);
      sessionStorage.setItem("password", this.form.password);

      this.$router.push({ path: "/photo" });
    },
  },
};
</script>
<style scoped>
.login {
  width: 100%;
  height: 100%;
  background-image: url("../assets/tire.webp");
  background-repeat: no-repeat;
}
.loginbox {
  width: 100%;
  padding-top: 50px;

  display: flex;
  justify-content: right;
}

.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}
.box-card {
  font-size: 24px;
}
.box-card {
  width: 380px;
  /* background-image: url("../assets/phtop.webp");
  background-repeat: no-repeat; */

  border-radius: 6px;
  background: #6bac6eab;
  width: 400px;
  padding: 25px 25px 5px 25px;
}
.el-form-item__label {
  font-size: 24px;
}
</style>
